package Exercises;

import java.util.Scanner;

public class Task21 {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		
		int max = 100;
		int min = 0;
		int success = 0;
		
		String question = "";
		String yes = "y";
		String str = "";
		String b = ">";
		String s = "<";
		while(true){
		
		int number = (int) ((Math.random()*(max - min ) + min ));
		
			System.out.println(number + " Is that your number? (y/n)");
				question = sc.nextLine();
					if(question.equals(yes))
					{
						System.out.println("I did it!!!");break;
					}
			
			System.out.println("Is it your number bigger or Smaller then " +number+ " (> or <) ");
			 
			str = sc.nextLine();
			
			if(str.equals(b))
			{
				min = number;
			}
			if (str.equals(s))
			{
				max = number;
			}
		}
	}

}
